package com.kly.sc.api.application.controller.user.response;


import com.kly.user.dto.LikeUserDto;
import com.kly.user.dto.UserInterestDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
@ApiModel(value = "wlm引导")
public class UserLikeResponse implements Serializable {

    @ApiModelProperty(value = "用户编号")
    private String userCode;

    @ApiModelProperty(value = "用户昵称")
    private String nickName;

    @ApiModelProperty(value = "性向")
    private String lookingForDesc;

    @ApiModelProperty(value = "头像")
    private String avatarUrl;

    @ApiModelProperty(value = "年龄")
    private Integer age;

    @ApiModelProperty(value = "关于")
    private String aboutMe;

    @ApiModelProperty(value = "在线状态")
    private Integer online;

    @ApiModelProperty(value = "nearby")
    private Integer nearby;

    @ApiModelProperty(value = "兴趣")
    private List<UserInterestDto> interests;

    @ApiModelProperty(value = "turnOns")
    private Integer TurnOnsListSize;

    public static UserLikeResponse toResponse(LikeUserDto likeUserDto, Boolean showTurnOnsFlag){
        UserLikeResponse userLikeResponse=new UserLikeResponse();
        userLikeResponse.setUserCode(likeUserDto.getUserCode());
        userLikeResponse.setNickName(likeUserDto.getNickName());
        userLikeResponse.setLookingForDesc(likeUserDto.getLookingForDesc());
        userLikeResponse.setAvatarUrl(likeUserDto.getAvatarUrl());
        userLikeResponse.setAge(likeUserDto.getAge());
        userLikeResponse.setAboutMe(likeUserDto.getAboutMe());
        userLikeResponse.setOnline(likeUserDto.getOnline());
        userLikeResponse.setNearby(likeUserDto.getNearby());
        userLikeResponse.setInterests(likeUserDto.getInterests());
        if (showTurnOnsFlag) {
            userLikeResponse.setTurnOnsListSize(0);
        } else {
            userLikeResponse.setTurnOnsListSize(likeUserDto.getTurnOnsListSize());
        }
        return userLikeResponse;
    }
}
